#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
    int k, i, j, h, t, q, d, m;
    scanf("%d", &k);
    while (k--) {
        int n;
        scanf("%d", &n);
        for (i = 1; i <= 10; i++) {
            if (i * i<n && (i + 1) * (i + 1)>n) {
                h = i + 1;
            }
            else if (i * i == n) {
                h = i;
            }
        }
        for (i = 1; i <= h; i++) {
            if (i == 1) {
                t = 2 * h;
                for (j = 0; j < t; j++) printf(" ");
                printf("*\n");
                for (j = 1; j < t; j++) printf(" ");
                printf("/ \\\n");
                for (j = 2; j < t; j++) printf(" ");
                printf("* - *\n");
            }
            else {
                t = 2 * (h - i + 1);
                if (n > i * i) d = 2 * i - 1;
                else d = n - (i - 1) * (i - 1);
                for (j = 1; j < t; j++) printf(" ");
                if (d % 2 != 0) {
                    for (q = 1; q <= d / 2 + 1; q++) {
                        printf("/ \\");
                        if (q < d / 2 + 1) printf(" ");
                        else printf("\n");
                    }
                }
                else if (d % 2 == 0) {
                    for (q = 1; q <= d / 2; q++) {
                        printf("/ \\");
                        if (q <= d / 2) printf(" ");
                    }
                    printf("/\n");
                }
                for (j = 2; j < t; j++) printf(" ");
                if (d % 2 != 0) {
                    printf("* - *");
                    for (q = 2; q <= d / 2 + 1; q++) {
                        printf(" - *");
                    }
                    printf("\n");
                }
                else if (d % 2 == 0) {
                    printf("* - *");
                    for (q = 2; q <= d / 2; q++) {
                        printf(" - *");
                    }
                    printf("\n");
                }
            }
        }
    }
    return 0;
}